<?php
class UCMC_Widget extends WP_Widget
{

    function __construct()
    {
        parent::__construct('UCMC', 'Up Comming Courses');
    }

    function widget($arg, $instance)
    {

        $title = apply_filters('widget_title', _trans('ucc.frm_title'));
        $num_posts = wp_count_posts('up-comming-course')->publish;
        echo $arg['before_widget'];
        echo $arg['before_title'] . $title . '<span class="badge pull-right bgred">'.$num_posts.'</span>' . $arg['after_title'];
        include_once (__dir__ . '/up_comming_course.html.php');
        echo $arg['after_widget'];
    }

    function form($instance)
    {

    }

    function update($newInstance, $oldInstace)
    {

    }
}
?>